package com.lyf.emall.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * @Author Lfy
 * @Date 2022/4/20-15:24
 */
public class IdUtils {

    private static Snowflake snowflake = IdUtil.getSnowflake();

    /**
     * 生成订单id
     * @return
     */
    public static String getOrderId(){
        String s = snowflake.nextIdStr();
        return s;
    }

    public static void main(String[] args) {
        System.out.println(IdUtils.getOrderId());
    }
}
